package com.atguigu.spzx.product.service.Impl;

import com.atguigu.spyx.model.common.com.atguigu.spyx.model.entity.product.Category;
import com.atguigu.spyx.model.common.com.atguigu.spyx.model.entity.product.ProductSku;
import com.atguigu.spyx.model.dto.h5.ProductSkuDto;
import com.atguigu.spyx.model.vo.h5.CategoryVo;
import com.atguigu.spyx.model.vo.h5.IndexVo;
import com.atguigu.spzx.product.mapper.CategoryMapper;
import com.atguigu.spzx.product.mapper.ProductMapper;
import com.atguigu.spzx.product.service.ProductService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author LT
 * @create 2023-11-17-18:38
 */
@Service
public class ProductServiceImpl implements ProductService {

    @Resource
    ProductMapper productMapper;

    @Resource
    CategoryMapper categoryMapper;

    @Override
    public IndexVo findCatesAndSkus() {
        List<Category> categoryList = categoryMapper.findCatesByPid(0l);
        List<ProductSku> productSkuList = productMapper.findSkuBySales();

        IndexVo indexVo = new IndexVo();
        indexVo.setCategoryList(categoryList);
        indexVo.setProductSkuList(productSkuList);
        return indexVo;
    }

}
